function fctCalcFreq()
{
	if(document.getElementById('form_detail')!=null)
	{
		var objElements = document.forms[0].elements;	
		var iTotElem = objElements.length;
		var iI;
		var dTPFreq = 0.0;
		var sChain = "";
		var sID = "";
		var iCytokines = 0;
		var iBand = 0;
	
		for(iI = 0; iI < iTotElem; iI++)
		{	
			if((objElements[iI].type == "text")&&(objElements[iI].value!= ""))
			{
				if(objElements[iI].name== "txtpfreq")
				{
					dTPFreq = dTPFreq + parseFloat(objElements[iI].value);
					sID = objElements[iI].id;
					sID = sID.substring(16);
					if(sChain != sID)
					{
						iCytokines = iCytokines + 1;
						sChain = sID;
					}
					iBand = 1;
				}
			}
		}
		if(iBand > 0)
		{
			document.getElementById("cyt_tcytokines").value=iCytokines+" cytokine(s) selected";	
			document.getElementById("cyt_tpfreq").value=dTPFreq.toFixed(1);
		}
	}
  	return false;
}
function fctValPFreq(objText)
{
	var sValue = objText.value;
	var fValue = parseFloat(objText.value);	
	
	if(sValue!="")
	{
		if(IsNumeric(sValue))
		{
			//... Validating Phenotype Frequency ...//
			if((fValue<0.0)||(fValue>100.0))
			{
				alert("Invalid data: '" + sValue +"'. Type a phenotype frequency between (0.0 and 100.0) or leave blank.");
				objText.focus();
			}
			else
			{
				//... Giving format to variables ...//
				objText.value = fValue.toFixed(1);
			}
		}
		else
		{
				alert("Invalid data: '" + sValue +"'. Type a number between (0.0 and 100.0) or leave blank.");				
				objText.focus();				
		}
	}
}
